﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microhard.Framework.MVCHelper;

namespace Microhard.Permission.MVCFilter
{
    public class BeforeUpdateActionFilter : IActionDataFilter
    {
        #region IActionDataFilter Members

        public virtual bool FilterAction(System.Web.Mvc.ActionExecutingContext filterContext, Models.User currentUser, List<Models.Permission> currentPermissions, Core.DBUtility.ScopeResult dataScope)
        {
            var identity = (Guid)filterContext.ActionParameters["identity"];
            this.PKID = identity;
            var rtn = dataScope.PKID.Contains(identity);
            return rtn;
        }

        public Guid PKID
        {
            set;
            get;
        }
        #endregion

     
    }
}
